import {createRouter,createWebHistory} from "vue-router";
const Home = ()=>import("@/views/home/index.vue");
const ViewWrapper = ()=>import("@/views/viewWrapper/index.vue");

// 公共路由
export const constantRoutes=[
    {
        path:"/login",
        name:"login",
        component:()=>import("@/views/login/index.vue")
    },
    {
        path:"/",
        name:"home",
        redirect:"/homepage",
        component:Home,
        children:[
            {
                path:"/homepage",
                name:"homepage",
                component:()=>import("@/views/home/homepage.vue"),
                meta:{
                    title:"首页"
                }
            }
        ]
    },
    {
        path:"/viewWrapper",
        name:"viewWrapper",
        component:ViewWrapper,
        children:[]
    }
];
// 动态路由-基于用户权限去加载
export const dynamicRoutes=[];

const router=createRouter({
    history:createWebHistory(),
    routes:constantRoutes
});


export default router;
